//
//  BaseView.m
//  PigMarket
//
//  Created by 张敬 on 2019/7/25.
//  Copyright © 2019年 pigmarket.oc. All rights reserved.
//

#import "BaseView.h"

@implementation BaseView

#pragma mark - lifecycle methods

- (instancetype)init{
    
    self = [super initWithFrame:CGRectMake(0, 0, KScreenWidth, 0)];
    if (self) {
        
        self.backgroundColor = KWhiteColor;
        [self.layer addSublayer:self.line];

        [self setupUI];
        [self setupLayout];
    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = KWhiteColor;

        [self setupUI];
        [self setupLayout];
    }
    return self;
}

- (void)setupUI{
    
}

- (void)setupLayout{
    
}


#pragma mark - getter methods
- (CAShapeLayer *)line{
    
    if (!_line) {
        _line = [CAShapeLayer layer];
        _line.fillColor = mIconLineColor.CGColor;
        UIBezierPath *path = [UIBezierPath bezierPathWithRect:CGRectMake(0, -0.5, KScreenWidth, 0.5)];
        _line.path = path.CGPath;
        _line.hidden = YES;
    }
    return _line;
}


@end
